package com.dpxm.zdbdg.charts.shuangseqiu.api;

import com.dpxm.zdbdg.charte.sand.vo.SanDChaiFen;
import com.dpxm.zdbdg.charts.shuangseqiu.service.KuaiLeBaService;
import com.dpxm.zdbdg.charts.shuangseqiu.service.KuaiLeBaSiDanAll;
import com.dpxm.zdbdg.charts.shuangseqiu.service.ShuangSeQiuService;
import com.dpxm.zdbdg.charts.shuangseqiu.service.ShuangSeQiuServiceKE;
import com.dpxm.zdbdg.charts.shuangseqiu.vo.*;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.List;

@RestController
@RequestMapping("/shaungseqiu/chart")
@CrossOrigin(origins = "*")
public class QueryShaungSeQiuApi {
    @Autowired
    private ShuangSeQiuService shuangSeQiuService;
    @Autowired
    private KuaiLeBaService kuaiLeBaService;
    @Autowired
    private KuaiLeBaSiDanAll kuaiLeBaSiDanAll;
    @Autowired
    private ShuangSeQiuServiceKE shuangSeQiuServiceKE;

    @ApiOperation("热号与冷号（16期内冷热分析）重号四个及以上热号，16期没有出过的算冷号,大于1小于4的算温热号")
    @GetMapping("/selecShuangSe/coldHot")
    @CrossOrigin
    public coldHotRes daLeTouLotColdHotMessage() throws IOException {
        return shuangSeQiuService.coldHot();
    }

    @ApiOperation("双色球查询号码List对象")
    @PostMapping("/selecShuangSe/mode")
    public  List<ShuangSeQiuStringVO> selectSanDVoMessage(String qishu)   {
        return shuangSeQiuService.selectShuangSeQiuVO(qishu);
    }

    /*
    * A:  杀的号当中10期以内选出出现次数在3到5的两个号 出现次数2到4的一个号
    * B:  没有杀的号当中以18期作为标准  选出出现次数7到10的两个号 出现次数4到7的一个号
    * */
    @ApiOperation("规则AB（柯）")
    @PostMapping("/selecShuangSe/incidentAB")
    public KeIncidentRes selectIncidentABMessage(IncidentReq req)   {
        return shuangSeQiuServiceKE.selectIncidentAB(req);
    }

    /*
    * C:   直落重号以25期以内作为参考 选出重号次数3到5次的 出两个
    * */
    @ApiOperation("规则C（柯）")
    @PostMapping("/selecShuangSe/incidentC")
    public KeIncidentRes selectIncidentCMessage(IncidentReq req)   {
        return shuangSeQiuServiceKE.selectIncidentC(req);
    }

    /*
     * D:   斜连号以15期为准 选出次数在3到5次的两个或者1个
     * */
    @ApiOperation("规则D（柯）")
    @PostMapping("/selecShuangSe/incidentD")
    public KeIncidentRes selectIncidentDMessage(IncidentReq req)   {
        return shuangSeQiuServiceKE.selectIncidentD(req);
    }

    /*
     * E:   以200期为准 出现次数最少的3个号
     * */
    @ApiOperation("规则E（柯）")
    @PostMapping("/selecShuangSe/incidentE")
    public KeIncidentRes selectIncidentEMessage(IncidentReq req)   {
        return shuangSeQiuServiceKE.selectIncidentE(req);
    }

    /*
     * ABCDE:  综合整理
     * */
    @ApiOperation("规则ABCDE（柯）")
    @PostMapping("/selecShuangSe/incidentABCDE")
    public KeIncidentRes selectIncidentABCDEMessage(IncidentReq req)   {
        return shuangSeQiuServiceKE.selectIncidentABCDE(req);
    }



    @ApiOperation("快乐8存储历史数据")
    @PostMapping("/saveKuaiLeBa")
    public String saveKuaiLeBaResMessage( @RequestBody PtKuaiLeBaVo ptQuerKuaiLeBa){
        return kuaiLeBaService.saveKuaiLeBa(ptQuerKuaiLeBa);
    }

    @ApiOperation("快乐8四胆以往开过的号码存储所有四胆")
    @GetMapping("/kuaiLeBa/sidan")
    public String selecKuaiLeBaResMessage(){
        return kuaiLeBaService.selectKuaiLeBa();
    }

    @ApiOperation("快乐8所有的四胆存表")
    @GetMapping("/saveKuaiLeBaSsiDan")
    public List<String> saveKuaiLeBaAll(){
        return kuaiLeBaSiDanAll.saveKuaiLeBaAll();
    }

    @ApiOperation("快乐8筛选没有开过的四胆")
    @GetMapping("/selectKuaiLeBaSsiDan")
    public KbSiDanRes selectKuaiLeBaSiDanNoResMessage(){
        return kuaiLeBaService.selectKuaiLeBaSiDan();
    }
}
